﻿using AutoTest.Business.Model;
using AutoTest.Framework.Ioc;

namespace AutoTest.Business.IServices.Auth
{
    /// <summary>
    /// 
    /// </summary>
    public interface IOpenAuthService
    {
        /// <summary>
        /// 获取开放平台的授权地址
        /// </summary>
        /// <param name="params">替换参数</param>
        /// <returns></returns>
        Task<string> GetAuthUrlAsync(Dictionary<string, object> @params);

        /// <summary>
        /// 获取开放平台的用户信息
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<OpenUserInfoModel> GetOpenUserInfoAsync(string code);

        /// <summary>
        /// 签名检查
        /// </summary>
        /// <param name="signature"></param>
        /// <param name="timestamp"></param>
        /// <param name="nonce"></param>
        /// <param name="echostr"></param>
        /// <returns></returns>
        string CheckSign(string signature, string timestamp, string nonce, string echostr);

        /// <summary>
        /// 获取Access_Token
        /// </summary>
        /// <param name="forcefresh"></param>
        /// <returns></returns>
        Task<string> GetWechatAccessTokenStable(bool forcefresh = false);
    }
}
